
#pragma once

#include <string>
#include <memory>
#include "gmap"
#include "glog_mc"
#include "c_subscribe"

typedef void(*pfunc_updatelog)(std::string& str);
class s_init
{
public:
	static s_init& impl();
	~s_init();

	unsigned int inital();
	unsigned int uninital();

	pfunc_updatelog _invoke_log = nullptr;

private:
	s_init();
	s_init(const s_init&) = delete;
	s_init& operator=(const s_init&) = delete;

	int __init_user();
	int __uninit_user();

	void __subscribe(const std::string& str_subscribekey, std::string& str_interface);
	std::string __str_subscribe_content = "";
	std::string __str_signal_content    = "";

	static void __invoke_aslog(void* reg_this, int ilog_level, std::string& str);
	void __aslog(int ilog_level, std::string& str);
	std::shared_ptr<mc::glog_mc> __plog = nullptr;

};
